class User:
    def __init__(self, userId, userName, clientSocket) -> None:
        self.userId = userId
        self.userName = userName
        self.ready = False
        self.isRoomMaster = False
        self.clientSocket = clientSocket
        self.room = None
        self.gaming = False


    def setRoomMaster(self, isRoomMaster):
        self.isRoomMaster = isRoomMaster


    def getClientSocket(self):
        return self.clientSocket
    
    
    def setReady(self):
        self.ready = True


    def cancelReady(self):
        self.ready = False

    
    def getRoom(self):
        return self.room
    

    def gameStart(self):
        self.gaming = True


    def gameEnd(self):
        self.gaming = False

    
    def isGaming(self):
        return self.gaming


    def toDTO(self):
        data = {}
        data["userId"] = self.userId
        data["userName"] = self.userName
        data["ready"] = self.ready
        data["isRoomMaster"] = self.isRoomMaster
        return data